/**
 * Created by 春旺 on 2017/3/28.
  */
//**********************************************************************************************************************
// SnakeEyes.java         Java Foundations
//
// Demonstrates the use of a programmer-defined class.
//**********************************************************************************************************************

public class SnakeEyes
{
    //------------------------------------------------------------------------------------------------------------------
    // Creates two Die object and rolls them several time , counting
    //  the number of snake eyes that occur.
    //------------------------------------------------------------------------------------------------------------------
    public static void main(String[] args)
    {
        final int ROLLS = 500;
        int num1, num2, count = 0;

        Die die1 = new Die();
        Die die2 = new Die();

        for (int roll = 0; roll <= ROLLS; roll ++ )
        {
            num1 = die1.roll();
            num2 = die2.roll();

            if (num1 == 1 && num2 ==1)
                count ++;
        }
        System.out.println("number of rolls: " + ROLLS);
        System.out.println("Number of snake eyes: " + count);
        System.out.println("Ratio:" + (float)count/ ROLLS);
    }

}
